/**
 * File Name   : ToIndex.java
 * Description : 
 */
package com.hh.portal.idx.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.hh.common.bean.PortalLocalBean;

/**
 * 跳转到首页
 * @author 冯昌硕
 * @create 2013-1-29 下午9:55:40
 */
public class ToIndexAction extends ActionSupport {

    private static final Logger log = Logger.getLogger(ToIndexAction.class);
    
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, 
            HttpServletRequest servletRequest, HttpServletResponse servletResponse) {
        log.debug("[ToIndexAction] request.host=[" + servletRequest.getLocalAddr() + "]");
        
        // 设置页面上要显示的当前位置
        PortalLocalBean firLocalBean = new PortalLocalBean();
        firLocalBean.setShowName("首页");
        firLocalBean.setHref("./idx.do");
        servletRequest.setAttribute("firLocalBean", firLocalBean);
        
        return actionMapping.findForward("idx");
    }
}
